package flc.ast.adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;

import org.jetbrains.annotations.NotNull;

import flc.ast.R;
import flc.ast.bean.ScreenRecordBean;
import flc.ast.databinding.ItemScreenRecordBinding;
import stark.common.basic.adapter.BaseDBRVAdapter;

public class ScreenRecordAdapter extends BaseDBRVAdapter<ScreenRecordBean, ItemScreenRecordBinding> {
    public ScreenRecordAdapter() {
        super(R.layout.item_screen_record, 0);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemScreenRecordBinding> holder, ScreenRecordBean item) {
        super.convert(holder, item);
        ItemScreenRecordBinding binding = holder.getDataBinding();
        binding.tvName.setText(item.getName());
        if (item.isSelect()) {
            binding.rlAll.setBackgroundColor(Color.parseColor("#2D37FF"));
            binding.tvName.setTextColor(Color.parseColor("#FFFFFF"));
        } else {
            binding.rlAll.setBackgroundColor(Color.parseColor("#FFFFFF"));
            binding.tvName.setTextColor(Color.parseColor("#8E8E8E"));
        }
    }
}
